/* 1822. 数组元素积的符号 */
/**
 * @param {number[]} nums
 * @return {number}
 */
var arraySign = function (nums) {
	if (nums.includes(0)) return 0
	const negative = nums.filter((num) => num < 0).length
	if (negative & 1) return -1
	return 1
}
var arraySign = function (nums) {
	let sign = 1
	for (const num of nums) {
		if (num === 0) return 0
		if (num < 0) {
			sign = -sign
		}
	}
	return sign
}
